/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Diana
 */
@Entity
@Table(name = "Tipo_Area")
@NamedQueries({
    @NamedQuery(name = "TipoArea.findAll", query = "SELECT t FROM TipoArea t"),
    @NamedQuery(name = "TipoArea.findByCodArea", query = "SELECT t FROM TipoArea t WHERE t.codArea = :codArea"),
    @NamedQuery(name = "TipoArea.findByDescArea", query = "SELECT t FROM TipoArea t WHERE t.descArea = :descArea"),
    @NamedQuery(name = "TipoArea.findByArea", query = "SELECT t FROM TipoArea t WHERE t.area = :area")})
public class TipoArea implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cod_area")
    private String codArea;
    @Basic(optional = false)
    @Column(name = "desc_area")
    private String descArea;
    @Column(name = "area")
    private String area;
    @OneToMany(mappedBy = "codArea")
    private List<UnidadOrganizativa> unidadOrganizativaList;

    public TipoArea() {
    }

    public TipoArea(String codArea) {
        this.codArea = codArea;
    }

    public TipoArea(String codArea, String descArea) {
        this.codArea = codArea;
        this.descArea = descArea;
    }

    public String getCodArea() {
        return codArea;
    }

    public void setCodArea(String codArea) {
        this.codArea = codArea;
    }

    public String getDescArea() {
        return descArea;
    }

    public void setDescArea(String descArea) {
        this.descArea = descArea;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public List<UnidadOrganizativa> getUnidadOrganizativaList() {
        return unidadOrganizativaList;
    }

    public void setUnidadOrganizativaList(List<UnidadOrganizativa> unidadOrganizativaList) {
        this.unidadOrganizativaList = unidadOrganizativaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codArea != null ? codArea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoArea)) {
            return false;
        }
        TipoArea other = (TipoArea) object;
        if ((this.codArea == null && other.codArea != null) || (this.codArea != null && !this.codArea.equals(other.codArea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.DAO.TipoArea[codArea=" + codArea + "]";
    }

}
